package com.peng.controller;

import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloController {
    @RequestMapping("/hello")
//    @PreAuthorize("hasAnyAuthority('sys:list1')")
    //通过SPEL表达式获取自定义的权限认证方法
    @PreAuthorize("@dp.hasAuthority('sys:list')")
    public String hello(){
        return "hello";
    }
}
